﻿using System;
using System.Collections;
using System.Windows.Forms;
using AppCommon.Framework;
using AppResources;
using SysCommon;
using SysCommon.Entity.Business;
using SysCommon.Entity.TMSIM.WS.Query;
using SysCommon.Entity.Map;
using SysCommon.Interface.BusinessGIS;
using SysCommon.Interface.StakeoutCar;
using SysCommon.Tools;
using Peccancy_Ety=SysCommon.Entity.Business.Peccancy_Ety;
using QueryCondition_Ety = SysCommon.Entity.TMSIM.WS.Stakeout.QueryCondition_Ety;
using LatestGPS_Ety = SysCommon.Entity.Business.LatestGPS_Ety;

using TMSIM.Client.CM.Event;
using System.Collections.Generic;

namespace TMSIM.Client.CM.UI.MainFrm
{
    public partial class RealTimeCtrl : UserControl
    {
       

        /// <summary>
        /// 接受Monitor发出的信息更新消息
        /// </summary>
        private RefreshRealTimeCtrlEventHandler m_pRefreshRealTimeCtrlEventHandler;


        public RealTimeCtrl()
        {
            try
            {
                InitializeComponent();
                TabCtrl_All.SelectedIndex = 2;

                dgp_RealTimeGps.dg_DataView.BackgroundColor =
                    System.Drawing.Color.White;
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error("调用出错", ex);
            }
        }

        #region void init()
        public void init()
        {
            try
            {
                

                btn_Bottom_Close.Image = AppResources.Res.Resources.GetImage("Close.jpg");
                tp_CurrStakeoutCarInfo.Enter += new EventHandler(tp_CurrStakeoutCarInfo_Enter);

                m_pRefreshRealTimeCtrlEventHandler = new RefreshRealTimeCtrlEventHandler();
                m_pRefreshRealTimeCtrlEventHandler.init();

                

                this.menu_RePlayHistory.Click += new EventHandler(menu_RePlayHistory_Click);
                this.menu_QueryPeccancy.Click += new EventHandler(menu_QueryPeccancy_Click);
                this.menu_QueryAVI.Click += new EventHandler(menu_QueryAVI_Click);
                this.tv_CarType.ExpandAll();

               
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error("调用init()出错", ex);
            }
        }
        #endregion

      

        #region 右键菜单操作
        /// <summary>
        /// 右键菜单
        /// 查看视频
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menu_QueryAVI_Click(object sender, EventArgs e)
        {
            try
            {
               
            }
            catch (Exception ex)
            {
                Global.mainLog.Error("调用 ISC_VideoStakeOutBizCtrl 方法出错", ex);
            }
        }

        /// <summary>
        /// 右键菜单
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menu_QueryPeccancy_Click(object sender, EventArgs e)
        {
            try
            {
               
            }
            catch (Exception ex)
            {
                Global.mainLog.Error("调用 ICIQS_TransgressQueryBizCtrl 方法出错", ex);
            }
        }

        /// <summary>
        /// 右键菜单
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menu_RePlayHistory_Click(object sender, EventArgs e)
        {
            try
            {
               
            }
            catch (Exception ex)
            {
                Global.mainLog.Error("调用 ISC_HistoryReplayBizCtrl 方法出错", ex);
            }
        }
        #endregion

        private void tp_CurrStakeoutCarInfo_Enter(object sender, EventArgs e)
        {
            tv_CarType.ExpandAll();
        }

        private void RealTimeCtrl_Resize(object sender, EventArgs e)
        {
            // btn_Bottom_Close.Left = Width - btn_Bottom_Close.Width - 5;
        }

        private void btn_Bottom_Close_Click(object sender, EventArgs e)
        {
            Visible = false;
        }

        private void InitTotalInfo()
        {
            txt_Total_OnlineCar.Text = "0";
            txt_Total_bus.Text = "0";
            txt_Total_dangerbus.Text = "0";
            txt_Total_HeaveTrucks.Text = "0";
            txt_Total_PeccancyCar.Text = "0";
            txt_Total_AlarmCar.Text = "0";
            txt_Total_WarnCar.Text = "0";
        }

        #region 车辆定位显示
        private void dg_DV_CurrStakeoutCar_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
               
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error("调用dg_DV_CurrStakeoutCar_CellDoubleClick出错", ex);
            }
        }

        private void PlaceByCarPlate(string inCarPlate)
        {
            try
            {
              
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error("IBGIS_RefeshCarBizCtrl.DisplayCarPlace调用时出错", ex);
            }
        }
        private void PlaceByCarPlate(SysCommon.Entity.Business.LatestGPS_Ety inCarPlate)
        {
            try
            {
               
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error("IBGIS_RefeshCarBizCtrl.DisplayCarPlace调用时出错", ex);
            }
        }

        private void dg_DV_Warn_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
               
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error("调用dg_DV_Warn_CellDoubleClick出错", ex);
            }
        }

        private void dg_DV_CallPolice_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
              
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error("调用dg_DV_CallPolice_CellDoubleClick出错", ex);
            }
        }

        private void dg_DV_Transgress_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
               
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error("调用dg_DV_Transgress_CellDoubleClick出错", ex);
            }
        }
        #endregion

        


        
    }
}